package com.yun.zf.common.admin.dto.pact;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
public class PactSearchResMo {

    @ApiModelProperty(value = "交易类型，1 租赁，2买卖")
    private String transactionType;
    @ApiModelProperty(value = "交易类型名称")
    private String typeName;
    @ApiModelProperty(value = "合同类型默认E 电子合同")
    private String pactType;
    @ApiModelProperty(value = "订单编号")
    private String orderId;
    @ApiModelProperty(value = "合同编号")
    private String pactId;

    @ApiModelProperty(value = "合同状态，C 已创建，Q已签约、J已解约、X 已续约")
    private String pactStatus;

    @ApiModelProperty(value = "房源编号")
    private String houseId;
    @ApiModelProperty(value = "房源地址")
    private String address;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "合同创建时间")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "合同生效时间")
    private Date pactEffectTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "合同到期时间")
    private Date pactEndTime;

    @ApiModelProperty(value = "签约人")
    private String signName;


    public String getTypeName() {
        String s="";
        switch (transactionType){
            case "1":
                s=  "租房";
                break;
            case "2":
                s=  "二手房";
                break;
        }
        return s;
    }
}
